﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PluginService.Common.Model
{
    public enum PluginMessageType
    {
        /// <summary>
        /// 错误信息
        /// </summary>
        ErrorInfo = -1,

        UnKnown = 0,

        One2OneResponse = 100,
        /// <summary>
        /// 1比1
        /// </summary>
        One2OneByBase64 = 101,

        One2OneByUrl = 102,

        /// <summary>
        /// 添加黑名单
        /// </summary>
        AddBlank = 103,

        /// <summary>
        /// 移除黑名单
        /// </summary>
        RemoveBlank = 104,

        /// <summary>
        /// 检测人脸特征
        /// </summary>
        DetectiveFaceFeature = 105,

        /// <summary>
        /// 获取黑名单
        /// </summary>
        GetBlank=106,

        /// <summary>
        /// 分页获取黑名单
        /// </summary>
        GetBlankPage=107,

        /// <summary>
        /// 获取黑名单总数
        /// </summary>
        GetBlankCount=108,

        /// <summary>
        /// 删除黑名单
        /// </summary>
        DelBlankByGuid=109,

        /// <summary>
        /// 删除所有黑名单
        /// </summary>
        DelAllBlank=110,

    }

    [Serializable]
    public class PluginMessage<T> where T:class
    {
        #region 变量

        protected PluginMessageType _pluginMessageType = PluginMessageType.UnKnown;
        protected string _sourceId;
        protected string _taskId;
        protected T _messageBody;

        #endregion

        #region 属性

        public PluginMessageType PluginMessageType
        {
            set { _pluginMessageType = value; }
            get { return _pluginMessageType; }
        }

        public string TaskId
        {
            get { return _taskId; }
            set { _taskId = value; }
        }

        public string SourceId
        {
            get { return _sourceId; }
            set { _sourceId = value; }
        }

        public T MessageBody
        {
            get { return _messageBody; }
            set { _messageBody = value; }
        }

        public bool Result { get; set; }

        public string Error { get; set; }

        #endregion
    }
}
